Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ics filter params #2647

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

add ics filter params #2647

wants to merge 17 commits into from

Conversation

YinHang2515
Copy link
Contributor

@YinHang2515 YinHang2515 commented Dec 4, 2024

For more information about how to contribute to this repo, visit this page.

Description

re-add otherAppState and Store e2e tests & add store size interface & add ics filter params

Main changes in the PR:

  1. e2e-test-data: otherAppState.json & store.json
  2. store.ts

Validation

Validation performed:

  1. use store.json e2e test file

Unit Tests added:

Unit tests are required for all changes. If no unit tests were added as part of this change, please explain why they aren't necessary.

No. No need for this change

End-to-end tests added:

Yes

Additional Requirements

Change file added:

Yes

@YinHang2515 YinHang2515 requested a review from a team as a code owner December 4, 2024 08:29
@YinHang2515
Copy link
Contributor Author

pending until hub-sdk pr checked in

Copy link
Contributor

@TrevorJoelHarris TrevorJoelHarris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please validate that dialog sizes aren't too small. It will never be valid for a developer to pass up a size <= 0 for either height or width.

* @internal
* Limited to Microsoft-internal use
*/
export const errorInvalidDialogSize = 'Invalid store dialog size';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export const errorInvalidDialogSize = 'Invalid store dialog size';
const errorInvalidDialogSize = 'Invalid store dialog size';

No need to export this. I'd actually like this to be moved into the function it's used in as well. Since we aren't using this string anywhere else there's no need to put it in the global namespace

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was resolved but no change was made and no explanation was given as to why no change was made.

@YinHang2515 YinHang2515 changed the title re-add otherAppState and Store e2e tests & add store size interface re-enable e2e tests & add store size interface & add filter params for ics Dec 18, 2024
@YinHang2515 YinHang2515 changed the title re-enable e2e tests & add store size interface & add filter params for ics add ics filter params Jan 6, 2025
* The installation scope (e.g., "Personal" | "Team").
* Defaults to "Personal".
*/
installationScope?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Things like appCapability, appMetaCapabilities, installationScope, and filteredOutAppIds should be more strongly typed than just strings and arrays of strings - just using strings here will make it very easy for consumers of this sdk to pass in invalid input - for example, what happens if they set installationScope to "personal" or "personal " or "Person"? Generally, you want to make app developer facing things as strongly typed as possible so that you can help them eliminate those kind of invalid input errors. When you that, depending on how you do it you may need to make those types serializable so that they can be stringified and passed to the host successfully.

Off the top of my head, the parameters you are adding here fall into two buckets:

  1. appCapability, appMetaCapabilities, and installationScope should all be enums (like StoreDialogType above). This will make sure that your code in the host only receives values that it is expecting. Going this way means that introducing new values will require future changes to this code.

  2. filteredOutAppIds should use the AppId class, defined in appId.ts. That file includes serialization and validation logic for AppIds.

Copy link
Contributor

@TrevorJoelHarris TrevorJoelHarris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've added some new functionality to this since I last reviewed it, so left some updated requests around typing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants